import React from 'react';
import { connect } from 'react-redux'
import { add } from '../store/actions'
class Add extends React.Component {
  render() {
    return <div className=''>
      <button onClick={this.props.add}>+</button>
    </div>;
  }
}
Add = connect(() => ({}), (dispatch) => {
  return {
    add() {
      // dispatch就是redux提供的哪个dispatch
      dispatch(add())
    }
  }
})(Add)
export default Add